<#assign tit>修改密码</#assign>
<@page.html title=tit>
<script type="text/javascript">
  function chk() {
    var fm = getEl("fm_input");
    if(fm.password.value!=fm.password2.value) {
      window.alert("重复密码输入不一致");
      return false;
    }
    if(fm.password.value==fm.oldPwd.value) {
      window.alert("新密码不能和旧密码一样");
      return false;
    }
    var pwd = fm.password.value;
    if(pwd.length<6) {
      window.alert("密码长度必须6位以上");
      return false;
    }
    var x=false, d=false, s=false, f=false;
    for(var i=0; i<pwd.length; i++) {
      var n = pwd.charCodeAt(i);
      if(n>=48 && n<=57)
        s = true;
      if(n>=65 && n<=90)
        d = true;
      if(n>=97 && n<=122)
        x = true;
      else
        f = true;
    }
    if(!x || !d || !s) {
      window.alert("密码需要包含大小写字母和数字");
      return false;
    }
    return true;
  }

  function postRet(data) {
    window.alert(data.msg);
    if(data.ret) {
      if(window.parent && window!=window.parent && window.parent.fmcload) {
        window.parent.fmcload(window.frameElement);
      } else {
        window.location = "./";
      }
    }
  }
</script>
<div style="width:400px; margin:50px auto 0;">
  <!--dl class="title"><dt class="edit">${tit}</dt></dl-->

  <form id="fm_input" method="post" action="_chgpwd" onsubmit="return post(this, chk);">
    <input type="hidden" name="userCode" value="${sysUser.userCode!}">
    <div class="kbox">
      <table class="input">
        <tr>
          <th width="35%">姓名</th>
          <td width="65%">${sysUser.userInfo.chName!}</td>
        </tr>
        <tr>
          <th>旧密码</th>
          <td><input type="password" name="oldPwd" value="" req="旧密码"><span class="require">*</span></td>
        </tr>
        <tr>
          <th>新密码</th>
          <td><input type="password" name="password" value="" req="新密码"><span class="require">*</span></td>
        </tr>
        <tr>
          <th>重复密码</th>
          <td><input type="password" name="password2" value="" req="重复新密码"><span class="require">*</span></td>
        </tr>
      </table>
    </div>
    <div class="button"><input type="submit" value="提 交"></div>
  </form>
</div>
</@page.html>